package com.demo.dao;

import com.demo.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @ClassName UserMapper
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/9 19:52
 * @Version 1.0
 **/
@Mapper
public interface UserMapper {
    @Select("select * from user")
    List<User> findAll();

    @Update("update user set name=#{name},sex=#{sex},pwd=#{pwd},birth=#{birth} where id=#{id}")
    int updateUser(User user);

    @Insert("insert into user values(0,#{name},#{sex},#{pwd},#{birth})")
    int insertUser(User user);
}
